import { is_object } from '@dataui/crud-util';
import { FindOptionsOrder, FindOptionsOrderValue } from 'typeorm';

export function isFindOptionsOrder(val: FindOptionsOrderValue | FindOptionsOrder<any>): val is FindOptionsOrder<any> {
  if (is_object(val) && !val.direction && !val.nulls) return true;
  return false;
}
